<!-- 首页 -->
<template>
    <h1>欢迎来到首页</h1>
    <input type="button" value="跳转用户页面" @click="toUser">
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

function toUser() {
    router.push('/user/123')
}

</script>